package org.activequant.util.ib;

public enum IBCategory {
	
	COUNTRY_FUNDS_CLOSED_END("Country Funds-Closed-end", IBIndustry.FINANCIAL),
	PRIVATE_EQUITY("Private Equity", IBIndustry.FINANCIAL),
	DIVERSIFIED_FINANCIAL_SERVICES("Diversified Finan Serv", IBIndustry.FINANCIAL),
	INVESTMENT_COMPANIES("Investment Companies", IBIndustry.FINANCIAL),
	BANKS("Banks", IBIndustry.FINANCIAL),
	REAL_ESTATE("Real Estate", IBIndustry.FINANCIAL),
	SAVINGS_AND_LOANS("Savings&Loans", IBIndustry.FINANCIAL),
	INSURANCE("Insurance", IBIndustry.FINANCIAL),
	REITS("REITS", IBIndustry.FINANCIAL),
	CLOSED_END_FUNDS("Closed-end Funds", IBIndustry.FINANCIAL),
	
	//FUNDS("Funds"
	DEBT_FUND("Debt Fund", IBIndustry.FUNDS),
	MONEY_MARKET_FUND("Money Market Fund", IBIndustry.FUNDS),
	REAL_ESTATE_FUND("Real Estate Fund", IBIndustry.FUNDS),
	EQUITY_FUND("Equity Fund", IBIndustry.FUNDS),
	COMMODITY_FUND("Commodity Fund", IBIndustry.FUNDS),
	ALTERNATIVE_INVESTMENT("Alternative Investment", IBIndustry.FUNDS),
	ASSET_ALLOCATION_FUND("Asset Allocation Fund", IBIndustry.FUNDS),
	
	STORAGE_WAREHOUSING("Storage/Warehousing", IBIndustry.CONSUMER_CYCLICAL),
	AUTO_PARTS_AND_EQUIPMENT("Auto Parts&Equipment", IBIndustry.CONSUMER_CYCLICAL),
	HOUSEWARES("Housewares", IBIndustry.CONSUMER_CYCLICAL),
	LEISURE_TIME("Leisure Time", IBIndustry.CONSUMER_CYCLICAL),
	DISTRIBUTION_WHOLESALE("Distribution/Wholesale", IBIndustry.CONSUMER_CYCLICAL),
	FOOD_SERVICE("Food Service", IBIndustry.CONSUMER_CYCLICAL),
	LODGING("Lodging", IBIndustry.CONSUMER_CYCLICAL),
	OFFICE_FURNISHINGS("Office Furnishings", IBIndustry.CONSUMER_CYCLICAL),
	APPAREL("Apparel", IBIndustry.CONSUMER_CYCLICAL),
	AUTO_MANUFACTURERS("Auto Manufacturers", IBIndustry.CONSUMER_CYCLICAL),
	HOME_FURNISHINGS("Home Furnishings", IBIndustry.CONSUMER_CYCLICAL),
	TEXTILES("Textiles", IBIndustry.CONSUMER_CYCLICAL),
	AIRLINES("Airlines", IBIndustry.CONSUMER_CYCLICAL),
	ENTERTAINMENT("Auto Manufacturers", IBIndustry.CONSUMER_CYCLICAL),
	RETAIL("Retail", IBIndustry.CONSUMER_CYCLICAL),
	TOYS_GAMES_HOBBIES("Toys/Games/Hobbies", IBIndustry.CONSUMER_CYCLICAL),
	HOME_BUILDERS("Home Builders", IBIndustry.CONSUMER_CYCLICAL),
	
	ENGINEERING_AND_CONSTRUCTION("Engineering&Construction", IBIndustry.INDUSTRIAL),
	METAL_FABRICATE_HARDWARE("Metal Fabricate/Hardware", IBIndustry.INDUSTRIAL),
	HAND_MACHINE_TOOLS("Hand/Machine Tools", IBIndustry.INDUSTRIAL),
	AEROSPACE_DEFENSE("Aerospace/Defense", IBIndustry.INDUSTRIAL),
	BUILDING_MATERIALS("Building Materials", IBIndustry.INDUSTRIAL),
	TRANSPORTATION("Transportation", IBIndustry.INDUSTRIAL),
	PACKAGING_AND_CONTAINERS("Packaging&Containers", IBIndustry.INDUSTRIAL),
	MISCELLANEOUS_MANUFACTURING("Miscellaneous Manufactur", IBIndustry.INDUSTRIAL),
	MACHINERY_DIVERSIFIED("Machinery-Diversified", IBIndustry.INDUSTRIAL),
	SHIPBUILDING("Shipbuilding", IBIndustry.INDUSTRIAL),
	TRUCKING_AND_LEASING("Trucking&Leasing", IBIndustry.INDUSTRIAL),
	ELECTRONICS("Electronics", IBIndustry.INDUSTRIAL),
	MACHINERY_CONSTRUCTION_AND_MINING("Machinery-Constr&Mining", IBIndustry.INDUSTRIAL),
	ENVIRONMENTAL_CONTROL("Environmental Control", IBIndustry.INDUSTRIAL),
	ELECTRICAL_COMPONENTS_AND_EQUIPMENT("Electrical Compo&Equip", IBIndustry.INDUSTRIAL),
	
	HOLDING_COMPANIES_DIVERSIFIED("Holding Companies-Divers", IBIndustry.DIVERSIFIED),
	
	BROAD_RANGE_EQUITY_INDEX("Broad Range Equity Index", IBIndustry.INDICES),
	VOLATILITY_INDEX("Volatility Index", IBIndustry.INDICES),
	
	CHEMICALS("Chemicals", IBIndustry.BASIC_MATERIALS),
	FOREST_PRODUCTS_AND_PAPER("Forest Products&Paper", IBIndustry.BASIC_MATERIALS),
	IRON_STEEL("Iron/Steel", IBIndustry.BASIC_MATERIALS),
	MINING("Mining", IBIndustry.BASIC_MATERIALS),
	
	ELECTRIC("Electric", IBIndustry.UTILITIES),
	WATER("Water", IBIndustry.UTILITIES),
	GAS("Gas", IBIndustry.UTILITIES),
	
	MUNICIPAL("Municipal", IBIndustry.GOVERNMENT),
	SOVEREIGN("Sovereign", IBIndustry.GOVERNMENT),
	MULTI_NATIONAL("Multi-National", IBIndustry.GOVERNMENT),
	REGIONAL_STATE_PROVINCE("Regional(state/provnc)", IBIndustry.GOVERNMENT),

	MEDIA("Media", IBIndustry.COMMUNICATIONS),
	ADVERTISING("Advertising", IBIndustry.COMMUNICATIONS),
	TELECOMMUNICATIONS("Telecommunications", IBIndustry.COMMUNICATIONS),
	INTERNET("Internet", IBIndustry.COMMUNICATIONS),
	
	OIL_AND_GAS_SERVICES("Oil&Gas Services", IBIndustry.ENERGY),
	ENERGY_ALTERNATE_SOURCES("Energy-Alternate Sources", IBIndustry.ENERGY),
	PIPELINES("Pipelines", IBIndustry.ENERGY),
	COAL("Coal", IBIndustry.ENERGY),
	OIL_AND_GAS("Oil&Gas", IBIndustry.ENERGY),
	
	AGRICULTURE("Agriculture", IBIndustry.CONSUMER_NON_CYCLICAL),
	COMMERCIAL_SERVICES("Commercial Services", IBIndustry.CONSUMER_NON_CYCLICAL),
	HOUSEHOLD_PRODUCTS_WARES("Household Products/Wares", IBIndustry.CONSUMER_NON_CYCLICAL),
	BEVERAGES("Beverages", IBIndustry.CONSUMER_NON_CYCLICAL),
	COSMETICS_PERSONAL_CARE("Cosmetics/Personal Care", IBIndustry.CONSUMER_NON_CYCLICAL),
	FOOD("Food", IBIndustry.CONSUMER_NON_CYCLICAL),
	PHARMACEUTICALS("Pharmaceuticals", IBIndustry.CONSUMER_NON_CYCLICAL),
	HEALTHCARE_PRODUCTS("Healthcare-Products", IBIndustry.CONSUMER_NON_CYCLICAL),
	BIOTECHNOLOGY("Biotechnology", IBIndustry.CONSUMER_NON_CYCLICAL),
	HEALTHCARE_SERVICES("Healthcare-Services", IBIndustry.CONSUMER_NON_CYCLICAL),
	
	OFFICE_BUSINESS_EQUIPMENT("Office/Business Equip", IBIndustry.TECHNOLOGY),
	SOFTWARE("Software", IBIndustry.TECHNOLOGY),
	COMPUTERS("Computers", IBIndustry.TECHNOLOGY),
	SEMICONDUCTORS("Semiconductors", IBIndustry.TECHNOLOGY);
	/**
	 * private IBIndustry industry;<br/>
	 * the industry(IBIndustry) this IBCategory belongs to
	 */
	private IBIndustry industry;
	/**
	 * private String value;
	 */
	private String value;
	/**
	 * constructs an IBCategory enum with the given value(String) and industry(IBIndustry)
	 * @param value
	 * @param industry
	 */
	IBCategory(String value, IBIndustry industry) {
		this.value = value;
		this.industry = industry;
	}
	
	public String toString() {
		return value;
	}
	/**
	 * Returns the IBCategory enum whose value(String) matches the given value(String).
	 * Throws an IllegalArgumentException if it can't find such enum
	 * @param value
	 * @return
	 */
	public static IBCategory toClass(String value) {
		for(IBCategory symbol: values()) {
			if(symbol.toString().equals(value)) {
				return symbol;
			}
		}
		throw new IllegalArgumentException("Value '"+value+"' not defined as constant.");
	}
	/**
	 * returns the associated value(String)
	 * @return
	 */
	public String getValue() {
		return value;
	}
	/**
	 * returns the associated industry(IBIndustry)<br/>
	 * this is the industry in which this category belongs
	 * @return
	 */
	public IBIndustry getIndustry() {
		return industry;
	}
	
}
